---
# tasks file for loopabull

- name: Install required packages
  package: name="{{ item }}" state=present
  with_items:
    - git
    - loopabull

- name: configure loopabull
  template:
    src: loopabull.yml.j2
    dest: /etc/loopabull.yml
  notify: restart loopabull

- name: clone the playbooks repo into playbooks dir
  git:
    repo: "https://pagure.io/releng-automation.git"
    dest: "{{playbooks_dir}}"

- name: Install the loopabull@.service template
  copy:
    src: "loopabull@.service"
    dest: "/usr/lib/systemd/system/loopabull@.service"
  notify: restart loopabull

- name: start and enable loopabull@
  service:
    name: "{{ item }}"
    state: started
    enabled: yes
  with_items:
    - loopabull@1
    - loopabull@2
    - loopabull@3
    - loopabull@4
    - loopabull@5

